package cn.iocoder.yudao.module.study.formatResult.enums;

import cn.hutool.core.util.ArrayUtil;
import lombok.Getter;

/**
 * @Author cjc
 * @Date 2024/5/17 17:38
 * @Description: 性别枚举
 * @Version 1.0
 */
@Getter
public enum SexTypeEnum {

    /**
     * 未知
     */
    UNKNOWN(1,"未知"),
    /**
     * 男
     */
    MALE(2,"男"),
    /**
     * 女
     */
    FEMALE(3,"女");

    private final Integer type;

    private final String desc;

    SexTypeEnum(Integer type,String desc){
        this.type = type;
        this.desc = desc;
    }

    public static SexTypeEnum valueOfType(Integer type) {
        return ArrayUtil.firstMatch(o -> o.getType().equals(type), values());
    }
}
